Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

metadata-added-provenance #730

Open
wants to merge 54 commits into
base: dtq-dev
Choose a base branch
from
Open

Conversation

Paurikova2
Copy link
Collaborator

@Paurikova2 Paurikova2 commented Aug 13, 2024

Phases MP MM MB MR JM Total
ETA 0 0 0 0 0 0
Developing 30 0 0 0 0 0
Review 0 0 0 0 0 0
Total - - - - - 0
ETA est. 0
ETA cust. - - - - - 0

Problem description

After adding, deleting, or editing the metadata of an item, a new record should be created in the metadata as dc.description.provenance.

@Paurikova2 Paurikova2 linked an issue Aug 13, 2024 that may be closed by this pull request
@Paurikova2
Copy link
Collaborator Author

Problem: the page is loading data from cache?

@milanmajchrak
Copy link
Collaborator

Checks are not green

milanmajchrak
milanmajchrak previously approved these changes Sep 10, 2024
milanmajchrak
milanmajchrak previously approved these changes Oct 17, 2024
@Paurikova2 Paurikova2 self-assigned this Nov 14, 2024
@Paurikova2
Copy link
Collaborator Author

@@ -552,6 +557,10 @@ private void updateBitstreamPolicies(Bitstream bitstream, Item item, BulkAccessC
*/
private void removeReadPolicies(DSpaceObject dso, String type) {
try {
String resPoliciesStr = provenanceProvider.removedReadPolicies(context, dso, type);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

explain

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

at the end

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

private void loadMessageTemplates() {
ObjectMapper mapper = new ObjectMapper();
String msg;
try (InputStream inputStream = getClass().getResourceAsStream(PROVENANCE_MSG_JSON)) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

~?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

return msg;
}

public String getResourcePoliciesMessage(List<ResourcePolicy> resPolicies) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overloading

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

import org.dspace.content.service.clarin.ClarinLicenseResourceMappingService;

/**
* ProvenanceProviderrest is responsible for creating provenance metadata for items based on the actions performed.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • ProvenanceProviderrest
  • why provider?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done
Created ProvenanceService

.collect(Collectors.joining(";"));
}

private Item getItem(Context context, Bitstream bitstream) throws SQLException {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Renamed to findItemByBitstream.
  2. This method call a clarinItemService.findByBitstreamUUID(...) method and process the response - log if there is no Item,..

try {
fileInputStream = uploadfile.getInputStream();
} catch (IOException e) {
log.error("Something went wrong when trying to read the inputstream from the given file in the request",
e);
throw new UnprocessableEntityException("The InputStream from the file couldn't be read", e);
}
try {
provenanceProvider.uploadBitstream(context, bundle);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -104,6 +107,7 @@ public void createCollectionToItemRelation(@PathVariable UUID uuid,

collectionService.addItem(context, collectionToMapTo, item);
collectionService.update(context, collectionToMapTo);
provenanceProvider.mappedItem(context, item, collectionToMapTo);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

try {
provenanceProvider.deleteBitstream(context, bitstreamToDelete);
bitstreamService.delete(context, bitstreamToDelete);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

order

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

} catch (SQLException e) {
throw new DSpaceBadRequestException("SQLException in DspaceObjectMetadataAddOperation.add trying to add " +
"metadata to dso.", e);
msg = "SQLException in DspaceObjectMetadataAddOperation.add trying to add " +

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

try {
if (index == null) {
provenanceProvider.removeMetadata(context, dso, metadataField);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Metadata edits and provenance
3 participants